﻿using J.FoodManageSet.Application.Command.SpecificationCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageSet.Application.CommandHandler.SpecificationCommandHandler
{
    /// <summary>
    /// 菜品规格删除
    /// </summary>
    public class SpecificationDeleteCommandHandler : IRequestHandler<SpecificationDeleteCommand, int>
    {
        private readonly ISpecificationRepository _specificationRepository;

        public SpecificationDeleteCommandHandler(ISpecificationRepository specificationRepository)
        {
            _specificationRepository = specificationRepository;
        }
        public async Task<int> Handle(SpecificationDeleteCommand request, CancellationToken cancellationToken)
        {
            var list = await _specificationRepository.SpecificationDelete(request.SpecificationId);
            return list;
        }
    }
}
